-
-
Notifications
You must be signed in to change notification settings - Fork 860
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: allowed LatLngBounds.center
to work across world boundary & added simpleCenter
#1860
Conversation
Impacted files: * `latlng_bounds.dart`: fixed the computation of `center` according to referenced link; added a more intuitive `simpleCenter` method. * `latlng_bounds_test.dart`: added the tests that failed in the initial issue
@josxha Did you have any other concerns about this? One thing maybe we should consider is writing a small doc snippet to compare them and which is better for what situation. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, although maybe a little bit of better documentation would be good? Maybe a diagram of where the two centers would calculate different values, and which is correct to use for which situation?
Will wait for @josxha to approve before merge.
LatLngBounds.center
and added simpleCenter
LatLngBounds.center
to work across world boundary & added simpleCenter
The changes in this pull request are straight forward. The only two things I struggle with are the name |
Regarding the naming: in the original code transformed here into dart, the description of the "complex" center is
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alright 👍
What
LatLngBounds.center
mentioned a [-180, +180] fix - now that fix is implemented.LatLngBounds.simpleCenter
is now implemented.Impacted files
latlng_bounds.dart
: fixed the computation ofcenter
according to referenced link; added a more intuitivesimpleCenter
method.latlng_bounds_test.dart
: added the tests that failed in the initial issue